package abstractfactory.creator;

import abstractfactory.creator.abstractorinterface.PizzaStore;
import abstractfactory.product.BaconPizza;
import abstractfactory.product.CheesePizza;
import abstractfactory.product.abstracts.Pizza;

/**
 * @ClassName: CNPizzaStore
 * @Description: 纽约披萨店
 * @Date: 2021/1/12 16:52
 * @Author: Song JinGen
 */
public class NYPizzaStore extends PizzaStore {

    private static final int CHEESE_PIZZA = 1;
    private static final int BACON_PIZZA = 2;

    private NYPizzaIngredientFactory factory = new NYPizzaIngredientFactory();
    @Override
    protected Pizza createPizza(int type) {
        Pizza pizza = null;
        switch (type){
            case CHEESE_PIZZA : pizza = new CheesePizza(factory); break;
            case BACON_PIZZA : pizza = new BaconPizza(factory); break;
        }

        return pizza;
    }
}
